

#ifndef LOG_SERVICE_IMPL_H
#define LOG_SERVICE_IMPL_H

#include <set>
#include <mutex>
#include "log_service.h"

class LogServiceImpl
{
public:
    static LogServiceImpl &instance(); // single skeleton

public:
    int init(std::set<LogService::LogType> &log_types);
    std::shared_ptr<spdlog::logger> create(const std::string &tag, spdlog::level::level_enum level);

private:
    LogServiceImpl(const LogServiceImpl &) = delete;
    LogServiceImpl &operator=(const LogServiceImpl &) = delete;
    LogServiceImpl();
    ~LogServiceImpl();

private:
    std::string pattern_;
    std::mutex lock_;
    std::vector<std::shared_ptr<spdlog::sinks::sink>> sinks_;

public:
    std::shared_ptr<spdlog::logger> default_logger;

};


#endif
